/******************************************************************************

  Copyright (C), 2001-2011, CSST  Co., Ltd.

 ******************************************************************************
  File Name     : LED.C
  
  Version       : Initial Draft
  
  Author        : kingezhou
  
  Created       : 2015/11/5
  
  Last Modified :
  
  Description   : this module help debug with led 

******************************************************************************/
#include "includes.h"
/*****************************************************************************
* funcation name   : LED_GPIO_Config
*
* input  : void
*
* Output  : none
* 
* Return Value : void
* 
* descryption: config led gpio ,and make it work
*
*****************************************************************************/
void LED_GPIO_Config(void)
{		
        GPIO_InitTypeDef GPIO_InitStructure;

        /* make GPIOA clock enable */
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;	
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;   
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
        GPIO_Init(GPIOA, &GPIO_InitStructure);
        GPIO_SetBits(GPIOA,GPIO_Pin_8);   

        /* make GPIOD clock enable */
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);   
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;	    		 
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; 		
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
        GPIO_Init(GPIOD, &GPIO_InitStructure);	
        GPIO_SetBits(GPIOD,GPIO_Pin_2); 	
        
        /* make GPIOC clock enable */
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);   
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;	    		 
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; 		 
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
        GPIO_Init(GPIOC, &GPIO_InitStructure);	
        GPIO_SetBits(GPIOC,GPIO_Pin_12); 	


}

void LED1_blink_ervery_1s(void)
{
    LED1_ON;
    OSTimeDlyHMSM(0,0,0,1000);           
    LED1_OFF;
    OSTimeDlyHMSM(0,0,0,1000);

}

void LED2_blink_ervery_1s(void)
{
    LED2_ON;
    OSTimeDlyHMSM(0,0,0,1000);           
    LED2_OFF;
    OSTimeDlyHMSM(0,0,0,1000);

}

void LED3_blink_ervery_1s(void)
{
    LED3_ON;
    OSTimeDlyHMSM(0,0,0,1000);           
    LED3_OFF;
    OSTimeDlyHMSM(0,0,0,1000);

}


